// pages/about/about.js
var util = require('../../utils/util.js');
var utilMd5 = require('../../utils/md5.js');
var WxParse = require('../../wxParse/wxParse.js');
var app = getApp();
var uid = 0;
var token = '';
var article = '';
var dataKey = '0';
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo: '',//关于企业
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
     var tc = app.get_tc();
    var that = this;
    that.setData({
      tc: tc,
    });

    

    util.api({
        data: {
          "uid": options.uid,
          "publickey": util.publiccode,
          "ac": "userinfo",
          //"tc": that.data.tc
        },
        success: function (responseData) {
          console.log(responseData.data);
          that.setData({
            userInfo: responseData.data
          });

          
          wx.setNavigationBarTitle({
            title: tc == 1 ? that.data.userInfo.uname_f : that.data.userInfo.uname
          }); 
          //处理艺术家简介简繁体
          if(that.data.tc == 1){
            WxParse.wxParse('message', 'html', that.data.userInfo.intro_f, that, 12); 
          } else {
            WxParse.wxParse('message', 'html', that.data.userInfo.intro, that, 12); 
          }
          
        }
      });
  },

  goAtherPage: function (e) {
    var url = e.currentTarget.dataset.link;
    if (url) {
      wx.navigateTo({ url: url });
    }
  },
})